<template>
	<view style="background-color: #f7f7f7;">
		<!-- 顶部蓝色背景 -->
		<view class="topimage">
			<!-- 顶部栏 -->
			<view class="title">
				<image src="../../../static/车联网服务-08我的-05我的车辆添加_slices/箭头.png" @click="back"></image>
				<view style="margin-left: 250rpx;">团购优惠</view>
			</view>
		</view>
		<!-- 上部主体部分 -->
		<view class="topZhuti" >
			<!-- <view class="text1">{{list.title}}</view> -->
			<view class="text1">汽车惠民活动走进群众生活</view>
			<view class="text2">
				<!-- <view class="21">{{list.name}}</view>
				<view class="22">{{list.publish_time}}</view> -->
				<view class="21">济源某某汽车行业</view>
				<view class="22">2023/3/10 11:22</view>
			</view>
			<view >
				<!-- <image class="image1" :src="list.activity_photo"></image> -->
				<image src="../../../static/wddd/优惠券.png"></image>
			</view>	
			<view class="text3">{{list.activity_content}}</view>
		</view>	
		<!-- 下部主体部分 -->
		<view class="bottomZhuti">
			<view class="zhengti">
			<view class="jiage">
				<view class="jiage1">价格：￥{{youHuiDetails.price}}</view>
				<view class="jiage2">原价：￥{{youHuiDetails.originalPrice}}</view>
			</view>
			<view class="shijian">活动起止日期：{{youHuiDetails.startTime}}至{{youHuiDetails.endTime}}</view>
			<view class="dianhua">咨询电话：{{youHuiDetails.phone}}</view>
			<view class="zhuyi">注意事项：{{youHuiDetails.notice}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '@/utils/api.js'
	export default {
		data() {
			return {
				activityId:null,
				list:[],
				youHuiDetails:{
					name:"汽车惠民活动走进群众生活",   //优惠名称
					manufacturer:"济源某某汽车行业",  //制造商
					time:"2023/3/10 11:09",         //时间
					image:"../../../static/车联网服务-07优惠团购_slices/优惠券活动图片_17.png",
					details:"哇噻!薅羊毛的看过来!易车修汽车维修服务中心出优惠团购了!纯手工洗车只要25元一次, 还增20元油券，够意思了吧!哇噻!薅羊毛的看过来!易车修汽车维修服务中心出优惠团购了!纯手工洗车只要25元一次，还增20元油券，够意思了吧!",  //详情
					price:"99.00", //价格
					originalPrice:"199.00", //原价
					startTime:"2023-3-10 08:00",  //活动开始时间
					endTime:"2023-3-18 23:59"  ,//活动结束时间
					phone:"0379-66666666",
					notice:"暂无"  //注意事项
				}
			}
		},
		methods: {
			async SelectAllById(){
				const res = await request({
					url:`/promotion/selectById?activityId=${this.activityId}`
				})
				this.list=res;
				// console.log("列表",this.list);
			},
			back() {
				uni.navigateBack({
					data: 1
				})
			},
		},
		onLoad(option){
			this.activityId=option.activityId;
			console.log("获取前一个",this.activityId);
			this.SelectAllById();
		},
		onShow() {
			console.log("111",this.youHuiDetails); //打印数据结构
			}
	}
</script>

<style lang="scss">
	.title {
		
		background-repeat: no-repeat;
		background-size: 100% 100%;
		height: 300rpx;
		display: flex;
		padding: 60rpx 300rpx 40rpx 30rpx;
		justify-content: space-between;
	
		image {
			color: white;
			width: 35rpx;
			height: 35rpx;
		}
	
		view {
			color: white;
		}
	}
	
	
	.topimage{
		display: flex;
		width: 100%;
		height: 430rpx;
		background-color: #3183fc;
	}
	// .topLan{
	// 	width: 100%;
	// 	display: flex;
	// 	position: absolute;
	// 	top: 60rpx;
	// 	justify-content: center;
	// 	align-items: center;
	// }
	// .left{
	// 	position: absolute;
	// 	left: 10rpx;	
	// }
	.topZhuti{
		background-color: white;
		width: 94%;
		margin: 0 auto;
		margin-top: -280rpx;
		text-align: center;
		border-radius: 10px;
		padding-bottom: 16rpx;
		padding-top: 38rpx ;
	}
	.text2{
		width: 92%;
		font-size: 11px;
		color: #9e9e9e;
		display: flex;
		justify-content: space-between;
		margin: 0 auto;
		margin-top: 20rpx;
		margin-bottom: 14rpx;
	}
	.image1{
		width: 92%;
		height: 394rpx;
		border-radius: 10px;
	}
	.text3{
		width: 92%;
		margin: 0 auto;
		line-height: 2;
		text-align: left;
		font-size: 12px;
	}
	.bottomZhuti{
		background-color: white;
		width: 94%;
		margin: 0 auto;
		margin-top: 20rpx;
		text-align: center;
		border-radius: 10px;
		padding-bottom: 32rpx;
		padding-top: 26rpx ;
	}
	.zhengti{
		width: 92%;
		text-align: left;
		margin: 0 auto;
	}
	.jiage{
		display: flex;
		align-items: center;
	}
	.jiage1{
		color: red;
		font-size: 14px;
	}
	.jiage2{
		padding-left: 30rpx;
		font-size: 11px;
		color: #a2a2a2;
		text-decoration: line-through;
	}
	.shijian{
		font-size: 12px;
		margin: 15rpx 0 15rpx 0;
	}
	.dianhua{
		font-size: 12px;
		margin: 15rpx 0 15rpx 0;
	}
	.zhuyi{
		font-size: 12px;
	}
	
</style>
